package mqttlib

//IOperator 网络线程接口类
type IOperator interface {
	//GetKey
	GetKey() string
	//SetKey
	SetKey(key string)
	//Start
	Start() bool
	//Modify
	Modify(params interface{}) bool
	//Delete
	Delete() bool
	//SendData
	SendData(buffer []uint8) bool
	//Close Fun
	Close() bool
}

//OperatorBase base IOperator
type OperatorBase struct {
	key string
	//Start
	//Start func() bool
	//Modify
	//Modify func(params string) bool
	//Delete
	//Delete func() bool
	//SendData
	//SendData func(buffer []uint8) bool
}

//GetKey Fun
func (_this *OperatorBase) GetKey() string {
	return _this.key
}

//SetKey Fun
func (_this *OperatorBase) SetKey(key string) {
	_this.key = key
}

//Start Fun
func (_this *OperatorBase) Start() bool {
	return false
}

//Modify Fun
func (_this *OperatorBase) Modify(params interface{}) bool {
	return false
}

//Close Fun
func (_this *OperatorBase) Close() bool {
	return false
}

//SendData Fun
func (_this *OperatorBase) SendData(buffer []uint8) bool {
	return false
}

//SetReceive Fun
func (_this *OperatorBase) SetReceive(self, callback func(key string, buffer []uint8)) {}

//Delete Fun
func (_this *OperatorBase) Delete() bool { return false }
